<%@Page Debug="True" %>

<%@ Import Namespace="Wrox" %>

<html>

<script runat="server">

  Sub RaiseException(Sender As Object, E As EventArgs)

    Throw New InvalidContentException("Content is invalid")

  End Sub

</script>

<form runat="server">
  <asp:Button Text="Raise Custom Exception" onclick="RaiseException" runat="server"/>
</form>

</html>